<?php

//家长详细

namespace app\voip\model;


use think\Model;

class EPatriarch extends Model
{


    public function setSexAttr($val)
    {

        $sex=0;
        switch ($val){
            case '男':
                $sex=1;
                break;
            case '女':
                $sex=2;
                break;
        }
        return $sex;
    }
    public function getSexAttr($value)
    {

        $sex = [1=>'男',2=>'女'];
        return $sex[$value];
    }
    public function getAgeAttr($value)
    {
        if (!empty($value)){
            $sex =[$value=>date("Y-m-d",$value)];
        }else{
            $sex=[$value=>$value];
        }
        return $sex[$value];
    }
    public function getPhoneAttr($value)
    {
        if (!empty($value)){
            $phone =[$value=>encryptTel($value)];
        }else{
            $phone=[$value=>$value];
        }
        return $phone[$value];
    }
}